package com.pascal91.webpp.service;

import com.pascal91.webpp.dao.MessageDao;
import com.pascal91.webpp.model.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService{

    @Autowired
    MessageDao messageDao;

    @Override
    @Transactional
    public List<Message> getMessagesList() {
        return messageDao.getMessagesList();
    }

    @Override
    @Transactional
    public void addMessage(Message message) {
        messageDao.addMessage(message);
    }
}
